package com.echo.code.thread.lock;

import java.util.concurrent.TimeoutException;

/**
 * lock Created by baiyap on 2018/9/24.
 */
public interface Lock {

  void lock() throws InterruptedException;

  void lock(long millis) throws InterruptedException, TimeoutException;

  void unlock();

  default String getCurrentThreadName() {
    return Thread.currentThread().getName();
  }
}
